﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Inspired.Euler.Tests
{
    /// <summary>
    /// Tests for problems from 50 to 59
    /// </summary>
    [TestClass]
    public class Problems050To059
    {
        [TestMethod]
        [Description("Which prime, below one-million, can be written as the sum of the most consecutive primes?")]
        public void Problem050()
        {
            Assert.AreEqual(997651, Euler.Problem050.Solve());
        }

        [TestMethod]
        [Description("Find the smallest prime which, by changing the same part of the number, can form eight different primes.")]
        public void Problem051()
        {
            Assert.AreEqual(-1, Euler.Problem051.Solve());
        }

        [TestMethod]
        [Description("Find the smallest positive integer, <i>x</i>, such that 2<i>x</i>, 3<i>x</i>, 4<i>x</i>, 5<i>x</i>, and 6<i>x</i>, contain the same digits in some order.")]
        public void Problem052()
        {
            Assert.AreEqual(-1, Euler.Problem052.Solve());
        }

        [TestMethod]
        [Description("How many values of C(<i>n</i>,<i>r</i>), for 1 = <i>n</i> = 100, exceed one-million?")]
        public void Problem053()
        {
            Assert.AreEqual(-1, Euler.Problem053.Solve());
        }

        [TestMethod]
        [Description("How many hands did player one win in the game of poker?")]
        public void Problem054()
        {
            Assert.AreEqual(-1, Euler.Problem054.Solve());
        }

        [TestMethod]
        [Description("How many Lychrel numbers are there below ten-thousand?")]
        public void Problem055()
        {
            Assert.AreEqual(-1, Euler.Problem055.Solve());
        }

        [TestMethod]
        [Description("Considering natural numbers of the form, <i>a<sup>b</sup></i>, finding the maximum digital sum.")]
        public void Problem056()
        {
            Assert.AreEqual(972, Euler.Problem056.Solve());
        }

        [TestMethod]
        [Description("Investigate the expansion of the continued fraction for the square root of two.")]
        public void Problem057()
        {
            Assert.AreEqual(-1, Euler.Problem057.Solve());
        }

        [TestMethod]
        [Description("Investigate the number of primes that lie on the diagonals of the spiral grid.")]
        public void Problem058()
        {
            Assert.AreEqual(-1, Euler.Problem058.Solve());
        }

        [TestMethod]
        [Description("Using a brute force attack, can you decrypt the cipher using XOR encryption?")]
        public void Problem059()
        {
            Assert.AreEqual(107359, Euler.Problem059.Solve());
        }
    }
}